from django.http import JsonResponse, HttpResponse
from realize.serializers import *
from rest_framework.decorators import api_view
from drf_yasg.utils import swagger_auto_schema
from drf_yasg import openapi


@swagger_auto_schema(
    method='get',
    operation_summary='获取航班信息',
)
@api_view(['GET'])
def get_air_data_all(request):
    p = AirLineData.objects.all()
    serializer = AirLineDataSerializer(p, many=True)
    return JsonResponse(serializer.data, safe=False)
